1 2 3 4 5 | cat count.txt | awk '{ sum+=$1} END {print sum}' # or numsum count.txt |
Reference: http://www.commandlinefu.com/commands/view/1497/using-awk-to-sumcount-a-column-of-numbers.
1 2 3 4 5 | cat count.txt | awk '{ sum+=$1} END {print sum}' # or numsum count.txt |
Reference: http://www.commandlinefu.com/commands/view/1497/using-awk-to-sumcount-a-column-of-numbers.
Hide Comments